import axios from "axios";

const service = axios.create({
    baseURL: process.env.VUE_APP_BASE_API,
    timeout:5000
})
service.interceptors.request.use(
    req=>{
        if(localStorage.getItem("token")){
            req.headers["token"] = localStorage.getItem("token")
        }else if(sessionStorage.getItem("token")){
            req.headers["token"] = sessionStorage.getItem("token")
        }
        return req
    }

)
export default service